import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Index,
    children:[{
      path:'/',
      redirect:'/me'
    },{
      path:'/home',
      name:'Home',
      component:()=>import('../views/Home.vue')
    },{
      path:'/shoppingcart',
      name:'ShoppingCart',
      component:()=>import('../views/ShoppingCart.vue')
    },{
      path:'/find',
      name:'Find',
      component:()=>import('../views/Find.vue')
    },{
      path:'/menu',
      name:'Menu',
      component:()=>import('../views/Menu.vue')
    },{
      path:'/me',
      name:'Me',
      component:()=>import('../views/Me.vue')
    }]
  },
  {
    path:'/search',
    name:'Search',
    component:()=>import('../views/Search.vue')
  },
  {
    path:'/order',
    name:'Order',
    component:()=>import('../views/Order.vue')
  },
  {
    path:'/buy',
    name:'Buy',
    component:()=>import('../views/Buy.vue')
  },
  {
    path:'/detail',
    name:'Detail',
    component:()=>import('../views/Detail.vue')
  },
  {
    path:'/rankList',
    name:'RankList',
    component:()=>import('../views/RankList.vue')
  },
  {
    path:'/address',
    name:'Address',
    component:()=>import('../views/Address.vue')
  },
  {
    path:'/addAddress',
    name:'AddAddress',
    component:()=>import('../views/AddAddress.vue')
  },
  {
    path:'/addressSelect',
    name:'AddressSelect',
    component:()=>import('../views/AddressSelect.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/OAddress',
    name: 'OAddress',
    component: () => import('../views/OAddress.vue')
  },
  {
    path: '/New',
    name: 'New',
    component: () => import('../views/New.vue')
  },
  {
    path: '/Kefu',
    name: 'Kefu',
    component: () => import('../views/kefu.vue')
  },
  {
    path: '/Message',
    name: 'Message',
    component: () => import('../views/Message.vue')
  },
  {
    path: '/Setup',
    name: 'Setup',
    component: () => import('../views/Setup.vue')
  },
  {
    path: '/MyList',
    name: 'MyList',
    component: () => import('../views/MyList.vue')
  },
  {
    path: '/Refund',
    name: 'Refund',
    component: () => import('../views/Refund.vue')
  },
  {
    path: '/Fapiao',
    name: 'Fapiao',
    component: () => import('../views/Fapiao.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/OAddress',
    name: 'OAddress',
    component: () => import('../views/OAddress.vue')
  },
  {
    path: '/New',
    name: 'New',
    component: () => import('../views/New.vue')
  },
  {
    path: '/Kefu',
    name: 'Kefu',
    component: () => import('../views/kefu.vue')
  },
  {
    path: '/Message',
    name: 'Message',
    component: () => import('../views/Message.vue')
  },
  {
    path: '/Setup',
    name: 'Setup',
    component: () => import('../views/Setup.vue')
  },
  {
    path: '/MyList',
    name: 'MyList',
    component: () => import('../views/MyList.vue')
  },
  {
    path: '/Refund',
    name: 'Refund',
    component: () => import('../views/Refund.vue')
  },
  {
    path: '/Fapiao',
    name: 'Fapiao',
    component: () => import('../views/Fapiao.vue')
  },
  {
    path:'/Mylist',
    name:'Mylist',
    component:()=>import("../views/MyList.vue"),
    children:[
      {
        path: '/All',
        name: 'All',
        component: () => import('../components/All.vue')
      },
      {
        path: '/Pay',
        name: 'Pay',
        component: () => import('../components/Pay.vue')
      },
      {
        path: '/Present',
        name: 'Present',
        component: () => import('../components/Present.vue')
      },
      {
        path: '/Senting',
        name: 'Senting',
        component: () => import('../components/Senting.vue')
      },
      {
        path: '/Evaluate',
        name: 'Evaluate',
        component: () => import('../components/Evaluate.vue')
      },   
    ]
  },
  {
    path:'/Refund',
    name:'Refund',
    component:()=>import("../views/Refund.vue"),
    children:[
      {
        path: '/Afsale',
        name: 'Afsale',
        component: () => import('../components/Afsale.vue')
      },
      {
        path: '/AllAfsale',
        name: 'AllAfsale',
        component: () => import('../components/AllAfsale.vue')
      },
    ]
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
